package com.qf.service.UserServiceImpl;

import com.qf.dao.UserDao;
import com.qf.dao.UserDaoImpl.UserDaoImpl2;
import com.qf.pojo.User;
import com.qf.service.UserService;
import org.junit.runners.Parameterized;

import javax.annotation.PostConstruct;
import java.util.ArrayList;
import java.util.List;

/**
 * @author Wy
 * @version V1.0
 * @Project MavenDemo
 * @Package com.qf.service.UserServiceImpl
 * @Description:
 * @Date 2022/6/2 10:09
 */
public class UserServiceImpl2 implements UserService {



      private UserDao userDaoImpl2;



      @PostConstruct
      public  void  init() {
          System.out.println("UserServiceImpl2初始化方法");
      }
      public  void  Destroy() {
          System.out.println("UserServiceImpl2销毁方法");
      }

    public UserServiceImpl2() {
        System.out.println("执行构造");
    }

    public UserDao getUserDaoImpl2() {

        return userDaoImpl2;
    }

    public void setUserDaoImpl2(UserDao userDaoImpl2) {
        System.out.println("set注入");
        this.userDaoImpl2 = userDaoImpl2;
    }

    public void registerUser() {

          userDaoImpl2.insertUser();
        System.out.println("===这是Userservice第二个实现类");
    }

    /**
     * 业务方法
     */
    public List<User> findUserAll() {
        System.out.println("执行了查询所有用户方法");

        return new ArrayList<User>();
    }

    public void insertUser(User user) {
        System.out.println("执行了添加用户的方法");

    }

    public void updateUser(User user) {
        System.out.println("执行了修改用户的方法");
    }

    public void delectUser(Integer id) {
        System.out.println("执行了删除用户的方法");
    }


}
